#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    char u;
    int n;
    cin>>u>>n;
    int a=1189,b=841;
    for(int i=1;i<=n;i++){
        if(a>b)a/=2;
        else b/=2;
    }
    if(a>b)cout<<a<<"\n"<<b<<endl;
    else cout<<b<<"\n"<<a<<endl;
    return 0;
}
